<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>index09-1</title>
</head>
<body>
index09-1内容
<br />
<a href="./index09-2.html">index09-2</a>
<input type="button" value="获取当前页面地址" onclick="getCurrentUrl()"/>
<input type="button" value="跳转到百度" onclick="gotoBaidu()"/>
<script type="text/javascript">

    function getCurrentUrl(){
        // window.可以省略不写
        console.log(window.location.href);
    }

    function gotoBaidu(){
        // 相当于a标签，直接做超链接
        window.location.href = 'http://www.baidu.com';
    }

</script>
</body>
</html>